def demo(num,*nums,**person):  # 参数名前增加*可以接受元组，参数名前增加**可以接受一个字典
    print(num)
    print(nums)
    print(person)

demo(1)
demo(1,2,3,4,name = "xiaoming",age = 18)


# 多值参数求和
# 通常将元组变量传递给args，字典变量传递给kwargs
def sum_num(*args):
# def sum_num(args):
    num = 0
    print(args)
    for n in args:
        num += n
    return num

result = sum_num(1,2,3,4,5)
# result = sum_num((1,2,3,4,5))
print(result)